#ifndef __FLASH_H
#define __FLASH_H
#include "device.h"

#define FLASH_IOCTL_ERASE     (1)
#define FLASH_IOCTL_SIZE      (2)
#define FLASH_IOCTL_COUNT     (3)

typedef struct
{
    uint32_t address;
    uint32_t size;
} erase,*erase_t;

typedef struct
{
    int             (* ioctl) (int cmd, void *arg);
    unsigned int    (* read) (unsigned int pos, void *buffer, unsigned int size, void *opt);
    unsigned int    (* write) (unsigned int pos, void *buffer, unsigned int size, void *opt);
    int             (* readable) (void);
    int             (* writeable) (void);
    void            (* flush) (void);
} FLASH_DISK,*FLASH_DISK_t;

#endif
